﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace Web
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //routes.MapRoute(
            //    name: "Default",
            //    url: "{controller}/{action}/{id}",
            //    defaults: new { controller = "account", action = "logon", id = UrlParameter.Optional}
            //    );

            routes.MapRoute(
                name: "jsapi",
                url: "jsapi/{0}",
                defaults: new { controller = "JavaScript", action = "jsconfig", key = UrlParameter.Optional },
                namespaces: new[] { "Web.Controllers" }
                );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "home", action = "index", id = UrlParameter.Optional },
                namespaces: new[] { "Web.Areas.Admin.Controllers" }
                ).DataTokens.Add("Area", "Admin");
        }
    }
}